Subject: Re: [amos-list] 2nd mouse & Floating point
From: one fang <[email-masked]>
To: [email-masked]
Date: Fri, 30 Jul 1999 23:05:48 +1000

From: one fang <[email-masked]>

Leto Kauler wrote:
> suggestion was that floating point calculations, which is supposed
> involved with arrays like:  PLAYER#()  are _very_ slow.  I've been
> using these arrays heaps in my new tank code!  I can not afford
> for the game to be slow.  What do other people know about this?
> If it's true, how can I get around it?

Floating point is always slower than integer.  What you do about it is
use fixed point maths.  Multiply all your floating point numbers by some
suitable power of ten, then do the math using the integer part and
convert back again later.  Better yet, don't bother with the conversion
steps at all, just treat the integers as if there was a decimal point in
them at a fixed point in the integer.  This is commonly known computer
science, not just AMOS.

-- 
Look out your Windows, the Penguins are coming, and they've got Balls!
David Seikel   dvs1   Digital Polyglot   World's Greatest Programmer.
"Any sufficiently advanced magic is indistinguishable from technology."
                              - with apologies to Arthur C. Clarke.

--------------------------- ONElist Sponsor ----------------------------

You can WIN $100 to Amazon.com by starting a new list at ONElist.
Drawing is held each week through August 20.  For details, go to
http://www.onelist.com/info/onereachsplash3.html

------------------------------------------------------------------------
Official AMOS WWW: http://members.xoom.com/AmosFactory/front.html